package windbell.domain.risk.impl;

import edu.fudan.mylang.pf.BaseModelObject;
import edu.fudan.mylang.pf.IObjectFactory;
import javax.persistence.MappedSuperclass;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import windbell.domain.risk.BaseHasSimplePy;
import windbell.domain.risk.proxy.BaseHasSimplePyProxy;

@MappedSuperclass
public class BaseHasSimplePyImpl extends BaseModelObject implements BaseHasSimplePy {
  public BaseHasSimplePyImpl() {
    super();
  }
  
  private String name;
  
  public String getName() {
    return this.name;
  }
  
  public BaseHasSimplePy setName(final String name) {
    this.name = name;
    return this;			
    
  }
  
  private String simplePy;
  
  public String getSimplePy() {
    return this.simplePy;
  }
  
  public BaseHasSimplePy setSimplePy(final String simplePy) {
    this.simplePy = simplePy;
    return this;			
    
  }
  
  public String getEntityName() {
    return this.name;
  }
  
  public String getNameField() {
    return "name";
  }
  
  public static BaseHasSimplePy create(final IObjectFactory objectFactory) {
    windbell.domain.risk.BaseHasSimplePy baseHasSimplePy = new windbell.domain.risk.impl.BaseHasSimplePyImpl(
    );
    objectFactory.create(baseHasSimplePy);
    return baseHasSimplePy;			
    
  }
  
  public static BaseHasSimplePy createBaseHasSimplePyImpl(final IObjectFactory objectFactory, final Procedure1<BaseHasSimplePy> init) {
    windbell.domain.risk.BaseHasSimplePy baseHasSimplePy = new windbell.domain.risk.impl.BaseHasSimplePyImpl(
    );
    objectFactory.create(baseHasSimplePy);
    init.apply(baseHasSimplePy);
    return baseHasSimplePy;			
    
  }
  
  public BaseHasSimplePyProxy toProxy() {
    windbell.domain.risk.proxy.BaseHasSimplePyProxy proxy = new windbell.domain.risk.proxy.BaseHasSimplePyProxy();
    proxy.setId(this.getId());
    if(this instanceof edu.fudan.mylang.pf.INamedModelObject){
    	proxy.setName(((edu.fudan.mylang.pf.INamedModelObject)this).getEntityName());
    }
    return proxy;
    
  }
}
